import sequelize from "../../db/dbConnext";
import { option } from "../../db/commomConfig";
import { DataTypes } from "sequelize";

import SysDeptEntity from "../../../entities/system/SysDeptEntity";
export type ISysUser = Omit<SysDeptEntity, "validateThis">;

const SysDeptModel = sequelize.define<any, ISysUser>(
  "sys_dept",
  {
    parentId: {
      type: DataTypes.INTEGER,
      allowNull: true,
    },
    deptName: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    ancestors: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    orderNum: {
      type: DataTypes.INTEGER,
      allowNull: true,
    },
    leader: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    phone: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    email: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    status: {
      type: DataTypes.STRING,
      allowNull: true,
    },
  },
  option
);
export default SysDeptModel;
